#class 类目 :
# pass
# class Person:
#     pass
# # 创建对象
# # 语法: 类名()
# p1 = Person()
# print(hex(id(p1)))  #10 -16
# print(p1, id(p1))
# # p2 = Person()
# # print(hex(id(p2)))
# # print(p2, id(p2))
# class Person:
#     def eat(self):
#         self.name = '杀破狼'
#     def cha(self):
#         self.age = '班机'
#
# p1 = Person()
# p1.eat()
# print(p1.name)
# p1.cha()
# p1.age = '哈哈'
# print(p1.age)
# class Pmeng:
#     pass
# p1 = Pmeng()
# p1.name = 'heelo'
# #获取属性
# #对象.属性名
# print(p1.name)
#  # 修改属性
# # 对象.属性名 = 属性值
# p1.name= 'good'
# print(p1.name)
# #删除属性
# # del p1.name
# # 定义类
# class Person:
#     def sun(self):
#         print(self)
#         print('跑')
# p1 = Person()
# print(p1)
# p1.sun()
# p1.sun()
class Oerson:
    def __init__(self):
        self.name = '朱自行'
        self.age = '18'
o1 = Oerson()
print(o1.name)
print(o1.age)
# 需求1: 创建2只猫, 一只名字叫 二狗, 另一只叫 大狗. 大狗3岁, 二狗 2岁. 分别输出他们的姓名和年龄.
# # 需求2: 说: 我的名字是:xxx, 我的年龄是xxx
class Mao:
    def __init__(self,name,age):
        self.name = name
        self.age = age
    def age1(self):
        print(f'我的名字是:{self.name},我的年龄是:{self.age}')
a1 = Mao('大狗',3)
a1.age1()
a2 = Mao('二狗',2)
a2.age1()



m1 = Mao('大狗', 3)
print(m1.name),print(m1.age)
#定义类
class Cat:
    def __init__(self,name):
        self.name = name
    def __str__(self):
        return  'asdasdasd'
cat1 = Cat('发财')
print(cat1)
cat2 = Cat('特斯拉')
print(cat2)
print(cat2.name)
print(cat2)
class Person:
    def __init__(self,name):
        self.name = name
    def __del__(self):
        print('del触发了')
p1 = Person('野孩子')
print(p1.name)
list1 = ['java', 'python', 'c', 'javascript', 'java']
list1.remove('java')
list1.remove('java')
print(list1)












